package cn.isjinhao.se.sql.grammar.statement.retrieve.represention;

import cn.isjinhao.se.sql.grammar.CurdStatementVisitor;
import cn.isjinhao.se.sql.grammar.CurdStatement;
import cn.isjinhao.se.sql.lexical.token.Token;

import java.util.List;

/**
 * @author 01395265
 * @date 2021/3/3
 */
public class InCondition extends CurdStatement {

    private Token in;

    private Token identifier;

    private List<CurdStatement> range;

    private CurdStatement curdStatement;


    public InCondition(Token in, Token identifier, CurdStatement curdStatement) {
        this.in = in;
        this.identifier = identifier;
        this.curdStatement = curdStatement;
    }
    public InCondition(Token in, Token identifier, List<CurdStatement> range) {
        this.in = in;
        this.identifier = identifier;
        this.range = range;
    }

    @Override
    public <R> R accept(CurdStatementVisitor<R> curdStatementVisitor) {
        return curdStatementVisitor.visitInCondition(this);
    }


    public Token getIn() {
        return in;
    }

    public Token getIdentifier() {
        return identifier;
    }

    public List<CurdStatement> getRange() {
        return range;
    }

    public CurdStatement getSelectStatement() {
        return curdStatement;
    }
}
